package br.com.core;

import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferStrategy;

public class GameCanvas extends Canvas {
	
	private Game game;
	private final int screenWidth = 640; 
    private final int screenHeight = 400;
    private Graphics g; 
    private BufferStrategy bf;
	
	public GameCanvas(){
		
		/*
		setBackground(Color.black);
		setIgnoreRepaint(true);
		createBufferStrategy(2);
		requestFocus();
			
		addMouseListener(new MouseControl());
	    addMouseMotionListener(new MouseControl());
	    //addKeyListener(new KeyBoardControl());
		*/
		
		//createBufferStrategy(2);
		//bf = getBufferStrategy();


	}
	
	public void addNotify() {
		super.addNotify();
		createBufferStrategy(2);
		bf = getBufferStrategy();
	}
	
	public Graphics getGameGraphics() {
		g = bf.getDrawGraphics();
		return g;
	}

	public void swapBuffers() {
		bf.show();
		g.dispose();
	}
		
}
